class WeChatUser:
    def __init__(self, username, user_id, is_whitelisted=False):
        self.username = username
        self.user_id = user_id
        self.is_whitelisted = is_whitelisted

    def to_dict(self):
        return {
            "username": self.username,
            "userId": self.user_id,
            "isWhitelisted": self.is_whitelisted
        }

    @staticmethod
    def from_dict(data):
        return WeChatUser(
            username=data.get('username'),
            user_id=data.get('userId'),
            is_whitelisted=data.get('isWhitelisted', False)
        )